package com.PAT.practice02;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/16/16:33
 * @Description:
 * @Target:
 * ppRYYGrrYBR2258
 * YrR8RrY
 * Yes 8
 *
 * ppRYYGrrYB225
 * YrR8RrY
 * No 2
 */
public class 到底买不买 {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String ss = in.nextLine();
        String target = in.nextLine();

        char[] chars = ss.toCharArray();
        char[] chars1 = target.toCharArray();
        ArrayList list = new ArrayList();
        for (Object o : chars) {
            list.add(o);
        }

        int num = 0;
        for (int i = 0; i < chars1.length; i++) {
            if (list.contains(chars1[i])){
                 list.remove((Character)(chars1[i]));
                num++;
            }
        }

        if (num==chars1.length){
            System.out.println("Yes "+list.size());
        }else {
            System.out.println("No "+(chars1.length-num));
        }


    }
}
